﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BaiduMapShortScrreen
{
    class JsController
    {
        public static object insertScript(WebBrowser webBrowser, string text)
        {
            HtmlElement script = webBrowser.Document.CreateElement("script");
            script.SetAttribute("type", "text/javascript");
            script.SetAttribute("text", text);
            HtmlElement head = webBrowser.Document.Body.AppendChild(script);
            if (head == null)
            {
                MessageBox.Show("创建脚本失败");
            }
            return head;
        }
    }
}
